var $ = jquery = layui.jquery;
var layer = layui.layer;
var laydate =  layui.laydate;

//时间
laydate.render({
    elem: '#count_bookTimeStart' 
  });
laydate.render({
    elem: '#count_bookTimeOver' 
  });

//count_book
$("#count_bookFilter").find('.tag').click(function() {
    $(this).siblings("span").removeClass('active');
    $(this).addClass('active');
}); 


var chart_book = echarts.init(document.getElementById('chart_book'));
var option_book = {
    title : {
        text: '书籍数占比',
        x:'center',
        textStyle:{
           color:"#333",
           fontWeight:"normal"
        }
    },
    tooltip : {
        trigger: 'item',
        formatter: "{b} : {c} ({d}%)"
    },
    legend: {
        data:['分类1','分类2','分类3','分类4'],
        bottom: 10
    },
    series : [
        {
            type: 'pie',
            radius : '55%',
            center: ['50%', '46%'],
            data:[
                {value:335, name:'分类1'},
                {value:310, name:'分类2'},
                {value:234, name:'分类3'},
                {value:135, name:'分类4'}
            ],
           label: { 
                formatter: '{b} {d}%'
           }
        }
    ]
};

chart_book.setOption(option_book);




var chart_read = echarts.init(document.getElementById('chart_read'));
var option_read = {
    title : {
        text: '阅读数占比',
        x:'center',
        textStyle:{
           color:"#333",
           fontWeight:"normal"
        }
    },
    tooltip : {
        trigger: 'item',
        formatter: "{b} : {c} ({d}%)"
    },
    legend: {
        data:['分类1','分类2','分类3','分类4'],
        bottom: 10
    },
    series : [
        {
            type: 'pie',
            radius : '55%',
            center: ['50%', '46%'],
            data:[
                {value:335, name:'分类1'},
                {value:310, name:'分类2'},
                {value:234, name:'分类3'},
                {value:135, name:'分类4'}
            ],
           label: { 
                formatter: '{b} {d}%'
           }
        }
    ]
};

chart_read.setOption(option_read);



var chart_collect = echarts.init(document.getElementById('chart_collect'));
var option_collect = {
    title : {
        text: '阅读数占比',
        x:'center',
        textStyle:{
           color:"#333",
           fontWeight:"normal"
        }
    },
    tooltip : {
        trigger: 'item',
        formatter: "{b} : {c} ({d}%)"
    },
    legend: {
        data:['分类1','分类2','分类3','分类4'],
        bottom: 10
    },
    series : [
        {
            type: 'pie',
            radius : '55%',
            center: ['50%', '46%'],
            data:[
                {value:335, name:'分类1'},
                {value:310, name:'分类2'},
                {value:234, name:'分类3'},
                {value:135, name:'分类4'}
            ],
           label: { 
                formatter: '{b} {d}%'
           }
        }
    ]
};

chart_collect.setOption(option_collect);